<?php defined('_JEXEC') or die('Restricted access'); ?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton)
{
	var form = document.adminForm;
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}

	// do field validation
	if (document.getElementById('jformgroup').value == ""){
		alert( "<?php echo JText::_( 'Name of the group is needed', true ); ?>" );
	} else if (document.getElementById('jformdate').value == "") {
		alert( "<?php echo JText::_( 'Please select a date.', true ); ?>" );
	} else if (document.getElementById('jformtime').value == ""){
		alert( "<?php echo JText::_( 'Please select a time.', true ); ?>" );
	} else if (document.getElementById('jformend').value == ""){
		alert( "<?php echo JText::_( 'Please select the ending time.', true ); ?>" );
	} else if (document.getElementById('jformend').value <= document.getElementById('jformtime').value){
		alert( "<?php echo JText::_( 'End time should be bigger than start time.', true ); ?>" );
	} else {
		submitform( pressbutton );
	}
}
</script>
<form action="<?php echo $this->action ?>" method="post" name="adminForm" id="adminForm">
<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
	<div class="componentheading<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
<?php endif; ?>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
	<td valign="top">
		<label for="jformgroup">
			<?php echo JText::_( 'Group' ); ?>:
		</label>
	</td>
	<td width="80%">
		<input class="inputbox" type="text" id="jformgroup" name="jform[group]" size="50" maxlength="250" value="" />
	</td>
</tr>
<tr>
	<td width="10%">
		<label for="jformdate">
			<?php echo JText::_( 'Date' ); ?>:
		</label>
	</td>
	<td width="80%">
	    <?php echo JHTML::_('calendar', $this->date, 'jform[date]', 'jformdate', '%d/%m/%Y', array('class'=>'inputbox', 'size'=>'25',  'maxlength'=>'19')); ?>
	</td>
</tr>
<tr>
	<td valign="top">
		<label for="jformtime">
			<?php echo JText::_( 'From' ); ?>:
		</label>
	</td>
	<td width="80%">
	<select class="selectbox"  id="jformtime" name="jform[time]">
	<option></option><option>00:00</option> <option>00:30</option> <option>01:00</option> <option>01:30</option> <option>02:00</option> <option>02:30</option> <option>03:00</option> <option>03:30</option> <option>04:00</option> <option>04:30</option> <option>05:00</option> <option>05:30</option> <option>06:00</option> <option>06:30</option> <option>07:00</option> <option>07:30</option> <option>08:00</option> <option>08:30</option> <option>09:00</option> <option>09:30</option> <option>10:00</option> <option>10:30</option> <option>11:00</option> <option>11:30</option> <option>12:00</option> <option>12:30</option> <option>13:00</option> <option>13:30</option> <option>14:00</option> <option>14:30</option> <option>15:00</option> <option>15:30</option> <option>16:00</option> <option>16:30</option> <option>17:00</option> <option>17:30</option> <option>18:00</option> <option>18:30</option> <option>19:00</option> <option>19:30</option> <option>20:00</option> <option>20:30</option> <option>21:00</option> <option>21:30</option> <option>22:00</option> <option>22:30</option> <option>23:00</option> <option>23:30</option>	</select>
	<?php echo JText::_( 'To' ); ?>:
	<select class="selectbox"  id="jformend" name="jform[end]">
	<option></option><option>00:00</option> <option>00:30</option> <option>01:00</option> <option>01:30</option> <option>02:00</option> <option>02:30</option> <option>03:00</option> <option>03:30</option> <option>04:00</option> <option>04:30</option> <option>05:00</option> <option>05:30</option> <option>06:00</option> <option>06:30</option> <option>07:00</option> <option>07:30</option> <option>08:00</option> <option>08:30</option> <option>09:00</option> <option>09:30</option> <option>10:00</option> <option>10:30</option> <option>11:00</option> <option>11:30</option> <option>12:00</option> <option>12:30</option> <option>13:00</option> <option>13:30</option> <option>14:00</option> <option>14:30</option> <option>15:00</option> <option>15:30</option> <option>16:00</option> <option>16:30</option> <option>17:00</option> <option>17:30</option> <option>18:00</option> <option>18:30</option> <option>19:00</option> <option>19:30</option> <option>20:00</option> <option>20:30</option> <option>21:00</option> <option>21:30</option> <option>22:00</option> <option>22:30</option> <option>23:00</option> <option>23:30</option>	</select>
	</td>
</tr>

</table>

<div>
	<button type="button" onclick="submitbutton('save')">
		<?php echo JText::_('Save') ?>
	</button>
	<button type="button" onclick="submitbutton('cancel')">
		<?php echo JText::_('Cancel') ?>
	</button>
</div>

	<input type="hidden" name="option" value="com_sharing" />
	<input type="hidden" name="task" value="save" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
<br /><br /><br />